#include <xscript/xmodule.h>
#include <xscript/xscriptexecutor.h>

XModule::XModule() {
}

void XModule::addCall(XCall::XCallPtr call) {
    calls.push_back(call);
}

bool XModule::invoke(std::shared_ptr<XVariableTable> table) {
    for (auto block : calls) {
        if (block->getType() != XCall::XCallType_Function) {
            auto success = block->invoke(table);
            if (!success)
                return false;
        }
    }
    return true;
}
